package com.wzy.vx.DTO;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.wzy.vx.Utils.EnumUtil;
import com.wzy.vx.Utils.serializer.Date2Long;
import com.wzy.vx.dataobject.OrderDetail;
import com.wzy.vx.dataobject.OrderMaster;
import com.wzy.vx.enums.OrderStatusEnum;
import com.wzy.vx.enums.PayStatusEnum;

import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @ProjectName: vx
 * @Package: com.wzy.vx.DTO
 * @ClassName: OrderDTO
 * @Author: Administrator
 * @Description: ${description}
 * @Date: 2019/3/12 18:27
 * @Version: 1.0
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class OrderDTO {
    private  String orderId;
    private String buyerName;
    private String buyerPhone;
    private String buyerAddress;
    private String buyerOpenid;
    private BigDecimal orderAmount;
    private Integer orderStatus;
    private Integer payStatus;
    @JsonSerialize(using = Date2Long.class)
    private Date categoryTime;
    @JsonSerialize(using = Date2Long.class)
    private Date updateTime;
    private List<OrderDetail> orderMasterList;

    @JsonIgnore
    public  OrderStatusEnum getOrderStatusEnum(){
        return EnumUtil.getByCode(orderStatus,OrderStatusEnum.class);
    }
    @JsonIgnore
    public  PayStatusEnum getPayStatusEnum(){
        return  EnumUtil.getByCode(payStatus,PayStatusEnum.class);
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getBuyerName() {
        return buyerName;
    }

    public void setBuyerName(String buyerName) {
        this.buyerName = buyerName;
    }

    public String getBuyerPhone() {
        return buyerPhone;
    }

    public void setBuyerPhone(String buyerPhone) {
        this.buyerPhone = buyerPhone;
    }

    public String getBuyerAddress() {
        return buyerAddress;
    }

    public void setBuyerAddress(String buyerAddress) {
        this.buyerAddress = buyerAddress;
    }

    public String getBuyerOpenid() {
        return buyerOpenid;
    }

    public void setBuyerOpenid(String buyerOpenid) {
        this.buyerOpenid = buyerOpenid;
    }

    public BigDecimal getOrderAmount() {
        return orderAmount;
    }

    public void setOrderAmount(BigDecimal orderAmount) {
        this.orderAmount = orderAmount;
    }

    public Integer getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(Integer orderStatus) {
        this.orderStatus = orderStatus;
    }

    public Integer getPayStatus() {
        return payStatus;
    }

    public void setPayStatus(Integer payStatus) {
        this.payStatus = payStatus;
    }

    public Date getCategoryTime() {
        return categoryTime;
    }

    public void setCategoryTime(Date categoryTime) {
        this.categoryTime = categoryTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public List<OrderDetail> getOrderMasterList() {
        return orderMasterList;
    }

    public void setOrderMasterList(List<OrderDetail> orderMasterList) {
        this.orderMasterList = orderMasterList;
    }
}
